package it.carlom.stickyheader.example.fragment;

import it.carlom.stickyheader.ResourceTable;
import it.carlom.stikkyheader.core.StikkyHeaderBuilder;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;
import ohos.agp.components.LayoutScatter;
import ohos.agp.components.ScrollView;

public class SimpleScrollViewFragment extends BaseFraction {

    public SimpleScrollViewFragment() {
    }

    @Override
    protected Component onComponentAttached(LayoutScatter scatter, ComponentContainer container, Intent intent) {
        return scatter.parse(ResourceTable.Layout_fragment_simplescrollview, container, false);
    }

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        ScrollView mScrollView = (ScrollView) getComponent().findComponentById(ResourceTable.Id_scroll);
        StikkyHeaderBuilder.stickTo(mScrollView)
                .setHeader(getComponent().findComponentById(ResourceTable.Id_header))
                .minHeightHeader(250)
                .build();
    }


}
